"""
找出不是两个数组共有的元素
"""
list1 = list(input().split()[1:])
list2 = list(input().split()[1:])
list3 = []
for i in list1:
    if i not in list2 and i not in list3:
        list3.append(i)
for i in list2:
    if i not in list1 and i not in list3:
        list3.append(i)
for i in range(0, len(list3)):
    if i == len(list3) - 1:
        print(list3[i], end='')
    else:
        print(list3[i], end=' ')
